package com.collect.collect.api.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.collect.collect.api.dao.DataMonitorMapper;
import com.collect.collect.api.entity.DataMonitor;
import com.collect.collect.api.entity.vo.DataMonitorVO;
import com.collect.collect.api.service.IDataMonitorService;
import com.collect.collect.api.service.ISlaveService;
import com.collect.collect.config.annotation.DataSource;
import com.collect.collect.config.enums.DataSourceType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

@Slf4j
@Service
@DataSource(value = DataSourceType.MASTER)
public class DataMonitorServiceImpl extends ServiceImpl<DataMonitorMapper, DataMonitor> implements IDataMonitorService {

    @Autowired
    private DataMonitorMapper dataMonitorMapper;

    @Autowired
    private ISlaveService slaveService;


    @Override
    public List<Map<String, Object>> getData(DataMonitorVO dataMonitorVO) {
        return dataMonitorMapper.getData(dataMonitorVO);
    }

    @Override
    public Set<String> selectDateColumn(String tableName) {
        return dataMonitorMapper.selectDateColumn(tableName);
    }
}